/*
 * @Description: 
 * @Author: Aaron Peng
 * @Date: 2022-08-07 19:06:45
 * @LastEditTime: 2022-08-08 23:26:26
 * @LastEditors: Aaron Peng
 */
import axios from 'axios';
import React, { Component } from 'react'
import "./index.scss"

export default class Ceo extends Component {
    constructor() {
        super();
        this.state = {
            List01: [],
            List02: [],
            List03: [],
        }
    }
    componentDidMount() {
        axios.post("https://srv.hotkidceo.com/appapi/api/root-ceo-content/ceoPage/pageList", { channelId: null, memberKey: "", roleKey: "", type: 1 }).then(res => {
            console.log(res);
            this.setState({
                List01: res.data.data[1].configureAttribute[0].list,
                List02: res.data.data[1].configureAttribute[1].list,
                List03: res.data.data[3].configureAttribute.list,
                List04: res.data.data[4].configureAttribute.list,
            })
        })
    }


    render() {
        let { List01, List02 } = this.state;
        return (
            <div>
                <div className='bg-img'></div>
                <div className='free'>
                    <div className='title'>免费零食</div>
                    <div className='tip'>每日领1款，天天0元享</div>
                    <div className='contaier'>
                        <ul className='contaier-con contaier-con01'>
                            {
                                List01.map((item, index) => <li key={index} className="con-t">
                                    <img src={item.listImages} alt={item.name} />
                                    <div className='goods-name'>{item.name}</div>
                                    <div className='title_01'>{item.displayName}</div>
                                    <div className='title_02'>￥{item.retailPrice}</div>
                                    <div className='goods-but'>{item.buyCartNum}元领</div>
                                </li>)
                            }
                        </ul>
                    </div>
                    <div className='tip'>限量供应，购物满99可享</div>
                    <div className='contaier'>
                        <ul className='contaier-con'>
                            {
                                List02.map((item, index) => <li key={index} className="con-t">
                                    <img src={item.listImages} alt={item.name} />
                                    <div className='goods-name'>{item.name}</div>
                                    <div className='title_01'>{item.displayName}</div>
                                    <div className='title_02'>￥{item.retailPrice}</div>
                                    <div className='goods-but'>{item.buyCartNum}元领</div>
                                </li>)
                            }
                        </ul>
                    </div>
                    <div className='tip'>限量供应，购物满149可享</div>
                </div>
            </div>
        )
    }
}
